package i18n;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class SearchPropertiesFiles {
	// private String separator = System.getProperty("file.separator");
	// private File racine = new
	// File(separator+"graphEd"+separator+"resources"+separator);

	//private File racine = new File("./src/graphEd/resources");
	//private File racine = new File("F:/workspace/ApplicationRenault/src/graphEd/resources");
	private File racine = new File("resources");

	public File getRacine(){
		return racine;
	}
	// private File racine = new
	// File("F:/workspace/ApplicationRenault/src/graphEd/resources");
	private List<Locale> langues = new ArrayList<Locale>();

	public SearchPropertiesFiles() {
		System.out.println("-->" + racine.getAbsolutePath());

		File[] directory = racine.listFiles();
		System.out.println("-->" + racine + " [" + directory.length + "]");
		for (File f : directory) {
			if (f.getName().contains("editor_")) {
				String language = f.getName().substring(7,
						f.getName().lastIndexOf("."));
				System.out.println(" - " + language+"\t"+f.getAbsolutePath());
				langues.add(new Locale(language));
			}
		}
	}

	public static void main(String[] args) {
		new SearchPropertiesFiles();
	}

	public List<Locale> getLangues() {
		return langues;
	}

	public void setLangues(List<Locale> langues) {
		this.langues = langues;
	}

}
